#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#define N 505
#define Mod 1000000007 
#define ll long long
using namespace std;
int n,k;
char s[N];
ll dp[2][N][N];
int x=0,y=1;
int main(){
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%d%d",&n,&k);
	cin>>s+1;
	
	if(s[1]=='?'){
		dp[x][1][0]=1;
		dp[x][0][1]=1;
	}
	if(s[1]=='('){
		dp[x][1][0]=1;
	}
	if(s[1]=='*'){
		dp[x][0][1]=1;
	}
	if(s[1]==')'){
		printf("0");
		fclose(stdin);
		fclose(stdout);
		return 0;
	}
	
	for(int i=2;i<=n;i++){
		memset(dp[y],0,sizeof(dp[y]));
		if(s[i]==')'){
			for(int a=1;a<=n;a++){
				for(int b=0;b<=k;b++){
					dp[y][a-1][0]+=dp[x][a][b];
					dp[y][a-1][0]%=Mod;
				}
			}
		}
		if(s[i]=='('){
			for(int a=0;a<=n;a++){
				for(int b=0;b<=k;b++){
					dp[y][a+1][0]+=dp[x][a][b];
					dp[y][a+1][0]%=Mod;
				}
			}
		}
		if(s[i]=='*'){
			for(int a=0;a<=n;a++){
				for(int b=0;b<k;b++){
					dp[y][a][b+1]+=dp[x][a][b];
					dp[y][a][b+1]%=Mod;
				}
			}
		}
		if(s[i]=='?'){
			for(int a=1;a<=n;a++){
				for(int b=0;b<=k;b++){
					dp[y][a-1][0]+=dp[x][a][b];
					dp[y][a-1][0]%=Mod;
				}
			}
			for(int a=0;a<=n;a++){
				for(int b=0;b<=k;b++){
					dp[y][a+1][0]+=dp[x][a][b];
					dp[y][a+1][0]%=Mod;
				}
			}
			for(int a=0;a<=n;a++){
				for(int b=0;b<k;b++){
					dp[y][a][b+1]+=dp[x][a][b];
					dp[y][a][b+1]%=Mod;
				}
			}
		}
		swap(x,y);
	}
	printf("%lld",dp[x][0][0]);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
